package com.syh.jn.scm.infrastructure.repository.model.finance;

import com.syh.core.ddd.infrastructure.repository.model.SuperBusinessModel;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * 对账单
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@Table(name = "T_FINANCE_STATEMENT_ACCOUNT_BILL_ITEM")
@EqualsAndHashCode(callSuper = true)
public class StatementAccountBillItemModel extends SuperBusinessModel {
  /**
   * 对账单id
   */
  @Column(name = "STATEMENT_ACCOUNT_BILL_ID", columnDefinition = "bigint COMMENT '对账单id'")
  private Long statementAccountBillId;
  /**
   * 来源单类型 0 销售单 1 销售退货单 2采购单 3 采购退货单 4 费用单 5 收入单
   */
  @Column(name = "SOURCE_TYPE", columnDefinition = "smallint COMMENT '来源单类型 0 销售单 1 销售退货单 2采购单 3 采购退货单 4 费用单 5 收入单'")
  private Short sourceType;
  /**
   * 来源单号
   */
  @Column(name = "SOURCE_CODE", columnDefinition = "varchar(50) COMMENT '来源单号'")
  private String sourceCode;
  /**
   * 来源单id
   */
  @Column(name = "SOURCE_ID", columnDefinition = "bigint COMMENT '来源单id'")
  private Long sourceId;
  /**
   * 单据总额
   */
  @Column(name = "TOTAL_AMOUNT", columnDefinition = "decimal(19,2) COMMENT '单据总额'")
  private BigDecimal totalAmount;

}
